package com.iflytek.sbd.demo.springflowtest;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;

/**
 * @program: sbd
 * @description:
 * @author: 陈英俊
 * @create: 2022-01-07 16:01
 */
@Component
@ConditionalOnProperty(
        prefix = "sbd",
        name = {"logPrint.open"},
        havingValue = "true"
)

public class MyBeanDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor {

    @Override
    public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
        System.out.println("执行   BeanDefinitionRegistryPostProcessor.postProcessBeanDefinitionRegistry的实现(MyBeanDefinitionRegistryPostProcessor)");
    }

    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        System.out.println("执行   BeanDefinitionRegistryPostProcessor.postProcessBeanFactory实现(MyBeanDefinitionRegistryPostProcessor)");
    }
}
